﻿namespace Test.Game
{
    using System;
    using System.Windows.Controls;

    using Furesoft.WPF.Game;

    using Test.Game.Screens;

    public class TestGame : Game
    {

        private GameScreen gs;

        public override void Draw()
        {
            
        }

        public override void Initialize()
        {
            ScreenManager.ScreenChanged += ScreenManagerOnScreenChanged;
            ScreenManager.Initialize(Window);

            ScreenManager.ChangeScreen(new WelcomeScreen());
        }

        private void ScreenManagerOnScreenChanged(object sender, EventArgs eventArgs)
        {
            if (sender is GameScreen)
            {
                gs = sender as GameScreen;
            }
        }

        public override void Update()
        {
            if (ScreenManager.CurrentScreen is GameScreen)
            {
                gs.Update();
            }
        }
    }
}
